Attribute VB_Name = "Module7"
Option Explicit

' Getwinsysdir = returns windows system directory
' Gettmppath = returns windows temp dir
' GetWinDir = returns windows path
'Windows declarations
Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const CB_FINDSTRING = &H14C
Private Const CB_ERR = (-1)

'Declarations for alternate code (see comments below)
Private Declare Function PostMessage Lib "User32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const CB_SETCURSEL = &H14E

'Private flag
Private m_bEditFromCode As Boolean


Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long

Public Const MAX_PATH = 260

Function GetWinDir()
'Dim Junk, WinDir$
'WinDir = Space(144)
'Junk = GetWindowsDirectory(WinDir, 144)
'WinDir = Trim(WinDir)

'GetWinDir = WinDir
End Function

Public Function GetTmpPath()
Dim strFolder As String
Dim lngResult As Long
strFolder = String(MAX_PATH, 0)
lngResult = GetTempPath(MAX_PATH, strFolder)
If lngResult <> 0 Then
  GetTmpPath = Left(strFolder, InStr(strFolder, _
  Chr(0)) - 1)
Else
  GetTmpPath = ""
End If
End Function


Function GetWinSysDir()
Dim Junk, WinSysDir$
WinSysDir = Space(144)
Junk = GetSystemDirectory(WinSysDir, 144)
WinSysDir = Trim(WinSysDir)

GetWinSysDir = WinSysDir
End Function


